package com.lichuang.fruitvarietysm.user.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lichuang.fruitvarietysm.user.entity.ShippingAddress;
import com.lichuang.fruitvarietysm.user.mapper.ShippingAddressMapper;
import com.lichuang.fruitvarietysm.user.service.IShippingAddressService;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 收货地址表 服务实现类
 * </p>
 *
 * @author shuaihang
 * @since 2019-05-27
 */
@Service
public class ShippingAddressServiceImpl extends ServiceImpl<ShippingAddressMapper, ShippingAddress> implements IShippingAddressService {

    @Override
    public String getShippingAddressTextById(Integer shipping_address_id) {
        StringBuilder addressText = new StringBuilder();
        ShippingAddress shippingAddress = baseMapper.selectById(shipping_address_id);
        addressText.append(shippingAddress.getReceiverProvince())
                .append(shippingAddress.getReceiverCity())
                .append(shippingAddress.getReceiverDistrict())
                .append(shippingAddress.getReceiverRow())
                .append(shippingAddress.getReceiverAddress())
                .append(" ")
                .append(shippingAddress.getReceiverName())
                .append(" ")
                .append(shippingAddress.getReceiverMobile());
        return addressText.toString();
    }
}
